package function

import (
	"GraduationProject/public/models"
	"GraduationProject/public/params"
	"GraduationProject/worker/neteasy_music/fetcher/normal"
	"GraduationProject/worker/neteasy_music/parser"
	"GraduationProject/worker/worker_tools"
)

func Pages(seed models.Record) (result params.Result) {
	content, err := normal.Get(seed.Url)
	if err != nil {
		seed.Error = err.Error()
		result.Result = []models.Record{seed}
		return
	}

	result.Seeds, result.Result = parser.Pages(seed, content)

	if !visited {
		worker_tools.Visited(seed)
	}
	return
}
